<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const set=new Set()
    //add has clear foEach delete
    set.add(1).add(2).add(3)
    console.log(set);
    console.log(set.has(1));
    console.log(set.has(4));
    // console.log(set.clear());
    //按照成员添加进入集合的顺序遍历
    set.forEach(function(value,key,s){
      //Set 中value=key
      console.log(value,key,set===s);
      console.log(this);
    },document)
    //使用delete删除不存在的成员，什么都不会发生，也不会报错
    set.delete(4)
    console.log(set.size);
    // console.log(set.values());

  </script>
</body>
</html>